package com.itheima.exerciseTest.test50_59;

import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;

public class Test50 {
    public static void main(String[] args) {
        FileInputStream fis = null;
        FileOutputStream fos = null;
        try {
            fis = new FileInputStream("backBurner\\a.txt");
            fos = new FileOutputStream("backBurner\\b.txt");

            byte[] bytes = new byte[1024];
            int len;
            while((len = fis.read(bytes)) != -1){
                // System.out.println(len);
                System.out.println(new String(bytes,0,len));
                fos.write(bytes,0,len);
            }
        } catch (IOException e) {
            e.printStackTrace();
        } finally {
            if(fis != null){
                try {
                    fis.close();
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
            if(fos != null){
                try {
                    fos.close();
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
        }

    }
}
